<?php
include("wideimage/WideImage.php");

function crop($width, $height, $loadingPath, $savingPath){
    $image = WideImage::load($savingPath);
    // only crop horizontal rectangle images
    if($image->getWidth() > $image->getheight()){
        $croppedImage = $image->crop('center', 'center', null, $height);
        $croppedImage->saveToFile($savingPath);    
    }
}

?>